package com.jackiechan.day18;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class Test_Socket {
    public static void main(String[] args) throws IOException {
//        Socket socket = new Socket("192.168.81.1",10000);
        Socket socket = new Socket("localhost",6546);
        InputStream in = socket.getInputStream();
        OutputStream out = socket.getOutputStream();
        out.write("hello".getBytes());
        out.flush();
        for (int i=0;i<5;i++){
            char c = (char)in.read();
            System.out.println(c);
        }
        socket.close();

//        Socket socket = new Socket("172.86.160.24",9527);
    }
}
